//
//  PostPhotoTableViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/3.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "PostPhotoTableViewCell.h"
#import "NewActionImg.h"
#import "UIImageView+WebCache.h"
#import "TAMacro.h"

@interface PostPhotoTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *postPhotoImageView;

@property (weak, nonatomic) IBOutlet UILabel *imageNumLabel;
@end

@implementation PostPhotoTableViewCell

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        
        self.contentView.backgroundColor = [UIColor colorWithWhite:0.917 alpha:1.000];
    }
    return self;
}

- (void)setActionImgArray:(NSArray<NewActionImg *> *)actionImgArray {
    _actionImgArray = actionImgArray;
    [_postPhotoImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _actionImgArray[0].f]]];
    _postPhotoImageView.contentMode = UIViewContentModeScaleAspectFill;
    _postPhotoImageView.layer.masksToBounds = YES;
//    NSLog(@"%ld", _actionImgArray.count);
    if (_actionImgArray.count <= 1) {
        _imageNumLabel.hidden = YES;
    } else {
        _imageNumLabel.hidden = NO;
        _imageNumLabel.text = [NSString stringWithFormat:@"%ld 图",  _actionImgArray.count];
    }
    
    
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
//    _imageNumLabel.layer.borderColor = [UIColor whiteColor].CGColor;
//    _imageNumLabel.layer.borderWidth = 2;
}

- (void)awakeFromNib {
    // Initialization code
    
    _imageNumLabel.layer.borderColor = [UIColor whiteColor].CGColor;
    _imageNumLabel.layer.borderWidth = 1;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
